Skip to content

cuda.core: validate pinned host memory pool support - #2487

Open
uday1o1 wants to merge 2 commits into
NVIDIA:mainfrom
uday1o1:fix/pinned-memory-capability-check
Open

cuda.core: validate pinned host memory pool support#2487
uday1o1 wants to merge 2 commits into
NVIDIA:mainfrom
uday1o1:fix/pinned-memory-capability-check

Conversation

@uday1o1

@uday1o1 uday1o1 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Description

Closes #2486.

PinnedMemoryResource.allocate() can return an unusable buffer when the stream's device does not support the requested host memory-pool type. The first transfer using that buffer then fails with CUDA_ERROR_INVALID_VALUE.

Validate HOST and HOST_NUMA memory-pool support before allocation. Unsupported requests now raise RuntimeError and identify LegacyPinnedMemoryResource as the alternative when stream-ordered allocation is not required.

This also documents the capability requirements and adds a regression test that runs on devices without host memory pool support.

Validation

  • CUDA 12 and CUDA 13 Cython translation
  • Jetson AGX Orin unsupported-device regression test
  • LegacyPinnedMemoryResource allocation and transfer round trip
  • Pre-commit checks for the changed files
  • Sphinx render with warnings treated as errors

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@copy-pr-bot

copy-pr-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the cuda.core Everything related to the cuda.core module label Aug 4, 2026
@uday1o1
uday1o1 force-pushed the fix/pinned-memory-capability-check branch 3 times, most recently from 5da214f to 2735740 Compare August 5, 2026 18:11
uday1o1 and others added 2 commits August 6, 2026 10:32
Reject unsupported host memory pools during allocation instead of allowing a later copy to fail with CUDA_ERROR_INVALID_VALUE.

Signed-off-by: Uday Arora <udaya@nvidia.com>
Drop the unnecessary CUDA 12 fence around host_memory_pools_supported,
raise RuntimeError instead of a synthetic CUDAError, and keep the
regression test hardware-gated for devices without host memory pools.
@Andy-Jost
Andy-Jost force-pushed the fix/pinned-memory-capability-check branch from 2735740 to 5b7c9b1 Compare August 6, 2026 17:35
@Andy-Jost
Andy-Jost marked this pull request as ready for review August 6, 2026 17:35
@Andy-Jost
Andy-Jost self-requested a review August 6, 2026 17:36
@Andy-Jost Andy-Jost self-assigned this Aug 6, 2026
@Andy-Jost Andy-Jost added bug Something isn't working P0 High priority - Must do! labels Aug 6, 2026
@Andy-Jost Andy-Jost added this to the cuda.core 1.2.0 milestone Aug 6, 2026
@Andy-Jost

Copy link
Copy Markdown
Contributor

/ok to test 5b7c9b1

@Andy-Jost
Andy-Jost enabled auto-merge (squash) August 6, 2026 17:38
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cuda.core Everything related to the cuda.core module P0 High priority - Must do!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: PinnedMemoryResource returns an unusable buffer when host memory pools are unsupported

2 participants